<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: lib/queue.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">queue.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="queue_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef _QUEUE_H_</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#define _QUEUE_H_</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Named address space</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#ifndef MEMSPACE</span></div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="queue_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">   29</a></span>&#160;<span class="preprocessor">#define MEMSPACE </span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="queue_8h.html#a991bfb3afb6f6913d6b216c7d9a74810">   32</a></span>&#160;<span class="preprocessor">#define QUEUE_OVERRUN       1</span></div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="queue_8h.html#a140a823cbbec938f79f3698c4e433d6c">   33</a></span>&#160;<span class="preprocessor">#define QUEUE_EOL           2</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structqueue__t.html">   36</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structqueue__t.html#aaee81421d150a17123a2b858d5b1685d">   37</a></span>&#160;    <span class="keywordtype">char</span> *<a class="code" href="structqueue__t.html#aaee81421d150a17123a2b858d5b1685d">buf</a>;      <span class="comment">/* Ring buffer */</span></div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structqueue__t.html#a2a516773a572c746d461c9df3cb30387">   38</a></span>&#160;    <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="structqueue__t.html#a2a516773a572c746d461c9df3cb30387">flags</a>;  <span class="comment">/* flags */</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structqueue__t.html#a7a6832e36c70a1db7fddc93fb6be9d63">   39</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="structqueue__t.html#a7a6832e36c70a1db7fddc93fb6be9d63">in</a>;      <span class="comment">/* input offset */</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structqueue__t.html#a8f6e1c623d2ceed398a71a0aab93b0fa">   40</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="structqueue__t.html#a8f6e1c623d2ceed398a71a0aab93b0fa">out</a>;     <span class="comment">/* output offset */</span></div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structqueue__t.html#a58398d4ee60bc90ffba2bc3488fe185b">   41</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="structqueue__t.html#a58398d4ee60bc90ffba2bc3488fe185b">bytes</a>;   <span class="comment">/* bytes used */</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="structqueue__t.html#a83a13b888f9d4ef127d706559818b779">   42</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="structqueue__t.html#a83a13b888f9d4ef127d706559818b779">size</a>;    <span class="comment">/* Ring buffer size */</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;} <a class="code" href="structqueue__t.html">queue_t</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">/* queue.c */</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<a class="code" href="structqueue__t.html">queue_t</a> *<a class="code" href="queue_8h.html#a9bdc538e328e481eb5f5b52ba10d36b9">queue_new</a> ( <span class="keywordtype">size_t</span> size );</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keywordtype">void</span> <a class="code" href="queue_8h.html#a6bac5e705b44fd0b677b9ff9b3a19a23">queue_del</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keywordtype">void</span> <a class="code" href="queue_8h.html#af654fe25b559b820fabf86f0a685e57a">queue_flush</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#a3d73971b8454e29803ddc0763a2413c6">queue_used</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#a5c47c1a42dc50ea36aab9629c4378b37">queue_empty</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#a6309ae001025faf270eb01c0f78c2cba">queue_space</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#ace76ddf1f8e6b6b0d836ff6ac0255311">queue_full</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#a69e47095291acc128fa52906bfe5cebf">queue_push_buffer</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q , <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *src , <span class="keywordtype">size_t</span> size );</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="queue_8h.html#aff31d44fd9a36c7e59740485c6142f4f">queue_pop_buffer</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q , <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *<a class="code" href="time_8c.html#a5a388b2bb2a2a9914c7d68ed3d09f7e9">dst</a> , <span class="keywordtype">size_t</span> size );</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keywordtype">int</span> <a class="code" href="queue_8h.html#a918e9bab1d67104964e167722a4d3793">queue_pushc</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q , <a class="code" href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> c );</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keywordtype">int</span> <a class="code" href="queue_8h.html#adc939b887e06d9c92507c37fa6a87cb8">queue_popc</a> ( <a class="code" href="structqueue__t.html">queue_t</a> *q );</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="ttc" id="structqueue__t_html_aaee81421d150a17123a2b858d5b1685d"><div class="ttname"><a href="structqueue__t.html#aaee81421d150a17123a2b858d5b1685d">queue_t::buf</a></div><div class="ttdeci">char * buf</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00037">queue.h:37</a></div></div>
<div class="ttc" id="time_8c_html_a5a388b2bb2a2a9914c7d68ed3d09f7e9"><div class="ttname"><a href="time_8c.html#a5a388b2bb2a2a9914c7d68ed3d09f7e9">dst</a></div><div class="ttdeci">dst_t dst</div><div class="ttdoc">DST start and stop in GMT epoch. </div><div class="ttdef"><b>Definition:</b> <a href="time_8c_source.html#l00052">time.c:52</a></div></div>
<div class="ttc" id="structqueue__t_html_a8f6e1c623d2ceed398a71a0aab93b0fa"><div class="ttname"><a href="structqueue__t.html#a8f6e1c623d2ceed398a71a0aab93b0fa">queue_t::out</a></div><div class="ttdeci">size_t out</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00040">queue.h:40</a></div></div>
<div class="ttc" id="queue_8h_html_a5c47c1a42dc50ea36aab9629c4378b37"><div class="ttname"><a href="queue_8h.html#a5c47c1a42dc50ea36aab9629c4378b37">queue_empty</a></div><div class="ttdeci">size_t queue_empty(queue_t *q)</div><div class="ttdoc">Is the ring buffer empty ? </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00114">queue.c:114</a></div></div>
<div class="ttc" id="queue_8h_html_aff31d44fd9a36c7e59740485c6142f4f"><div class="ttname"><a href="queue_8h.html#aff31d44fd9a36c7e59740485c6142f4f">queue_pop_buffer</a></div><div class="ttdeci">size_t queue_pop_buffer(queue_t *q, uint8_t *dst, size_t size)</div><div class="ttdoc">Get a data buffer from the ring buffer. Note: This function does not wait/block until there is enough...</div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00186">queue.c:186</a></div></div>
<div class="ttc" id="structqueue__t_html_a7a6832e36c70a1db7fddc93fb6be9d63"><div class="ttname"><a href="structqueue__t.html#a7a6832e36c70a1db7fddc93fb6be9d63">queue_t::in</a></div><div class="ttdeci">size_t in</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00039">queue.h:39</a></div></div>
<div class="ttc" id="queue_8h_html_a6309ae001025faf270eb01c0f78c2cba"><div class="ttname"><a href="queue_8h.html#a6309ae001025faf270eb01c0f78c2cba">queue_space</a></div><div class="ttdeci">size_t queue_space(queue_t *q)</div><div class="ttdoc">Find the amount of free space remaining in the ring buffer. </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00128">queue.c:128</a></div></div>
<div class="ttc" id="queue_8h_html_a69e47095291acc128fa52906bfe5cebf"><div class="ttname"><a href="queue_8h.html#a69e47095291acc128fa52906bfe5cebf">queue_push_buffer</a></div><div class="ttdeci">size_t queue_push_buffer(queue_t *q, uint8_t *src, size_t size)</div><div class="ttdoc">Add a data buffer to the ring buffer Note: This function does not wait/block util there is enough fre...</div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00157">queue.c:157</a></div></div>
<div class="ttc" id="queue_8h_html_af654fe25b559b820fabf86f0a685e57a"><div class="ttname"><a href="queue_8h.html#af654fe25b559b820fabf86f0a685e57a">queue_flush</a></div><div class="ttdeci">void queue_flush(queue_t *q)</div><div class="ttdoc">Flush ring buffer. </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00087">queue.c:87</a></div></div>
<div class="ttc" id="queue_8h_html_ace76ddf1f8e6b6b0d836ff6ac0255311"><div class="ttname"><a href="queue_8h.html#ace76ddf1f8e6b6b0d836ff6ac0255311">queue_full</a></div><div class="ttdeci">size_t queue_full(queue_t *q)</div><div class="ttdoc">Is the ring buffer full ? </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00140">queue.c:140</a></div></div>
<div class="ttc" id="structqueue__t_html_a58398d4ee60bc90ffba2bc3488fe185b"><div class="ttname"><a href="structqueue__t.html#a58398d4ee60bc90ffba2bc3488fe185b">queue_t::bytes</a></div><div class="ttdeci">size_t bytes</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00041">queue.h:41</a></div></div>
<div class="ttc" id="structqueue__t_html"><div class="ttname"><a href="structqueue__t.html">queue_t</a></div><div class="ttdoc">queue structure </div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00036">queue.h:36</a></div></div>
<div class="ttc" id="structqueue__t_html_a2a516773a572c746d461c9df3cb30387"><div class="ttname"><a href="structqueue__t.html#a2a516773a572c746d461c9df3cb30387">queue_t::flags</a></div><div class="ttdeci">uint8_t flags</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00038">queue.h:38</a></div></div>
<div class="ttc" id="queue_8h_html_adc939b887e06d9c92507c37fa6a87cb8"><div class="ttname"><a href="queue_8h.html#adc939b887e06d9c92507c37fa6a87cb8">queue_popc</a></div><div class="ttdeci">int queue_popc(queue_t *q)</div><div class="ttdoc">Remove a byte from the ring buffer Note: This function does not wait/block util there is data to meet...</div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00244">queue.c:244</a></div></div>
<div class="ttc" id="queue_8h_html_a9bdc538e328e481eb5f5b52ba10d36b9"><div class="ttname"><a href="queue_8h.html#a9bdc538e328e481eb5f5b52ba10d36b9">queue_new</a></div><div class="ttdeci">queue_t * queue_new(size_t size)</div><div class="ttdoc">Create a ring buffer of a given size. </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00038">queue.c:38</a></div></div>
<div class="ttc" id="queue_8h_html_a918e9bab1d67104964e167722a4d3793"><div class="ttname"><a href="queue_8h.html#a918e9bab1d67104964e167722a4d3793">queue_pushc</a></div><div class="ttdeci">int queue_pushc(queue_t *q, uint8_t c)</div><div class="ttdoc">Add a byte to the ring buffer Note: This function does not wait/block util there is enough free space...</div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00216">queue.c:216</a></div></div>
<div class="ttc" id="queue_8h_html_a6bac5e705b44fd0b677b9ff9b3a19a23"><div class="ttname"><a href="queue_8h.html#a6bac5e705b44fd0b677b9ff9b3a19a23">queue_del</a></div><div class="ttdeci">void queue_del(queue_t *q)</div><div class="ttdoc">Delete a ring buffer and free memory. </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00062">queue.c:62</a></div></div>
<div class="ttc" id="send_8c_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="send_8c.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> <a href="send_8c_source.html#l00017">send.c:17</a></div></div>
<div class="ttc" id="structqueue__t_html_a83a13b888f9d4ef127d706559818b779"><div class="ttname"><a href="structqueue__t.html#a83a13b888f9d4ef127d706559818b779">queue_t::size</a></div><div class="ttdeci">size_t size</div><div class="ttdef"><b>Definition:</b> <a href="queue_8h_source.html#l00042">queue.h:42</a></div></div>
<div class="ttc" id="queue_8h_html_a3d73971b8454e29803ddc0763a2413c6"><div class="ttname"><a href="queue_8h.html#a3d73971b8454e29803ddc0763a2413c6">queue_used</a></div><div class="ttdeci">size_t queue_used(queue_t *q)</div><div class="ttdoc">Find the number of bytes used by the ring buffer. </div><div class="ttdef"><b>Definition:</b> <a href="queue_8c_source.html#l00102">queue.c:102</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
